package com.itsoku.controller;

import com.yomahub.liteflow.core.FlowExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author fengleifl-hzgs
 * @Date 2025/9/4
 * @since
 */
@RestController
public class FlowController {

    @Autowired
    private FlowExecutor flowExecutor;
    @GetMapping("/runFlow")
    public String runFlow() {
        try {
            flowExecutor.execute2Resp("chain1");
            return "流程执行成功";
        } catch (Exception e) {
            return "流程执行失败: " + e.getMessage();
        }
    }
}
